/// 用户列表模型
class UserList {
  /// 包含 UserItem 模型的集合
  List<UserInfo> list;

  UserList(this.list);

  /// 循环后台返回的数组 将每一项组装成 UserItem
  factory UserList.fromJson(List<dynamic> list) {
    return UserList(list.map((item) => UserInfo.fromJson(item)).toList());
  }
}

class UserInfo {
  late int id;
  String? coverPictureUrl;
  String? nickname;
  String? type;
  int? musicCount;
  int? musicPlayCount;

  UserInfo(
      {required this.id,
      this.coverPictureUrl,
      this.nickname,
      this.type,
      this.musicCount,
      this.musicPlayCount});

  factory UserInfo.fromJson(dynamic json) {
    return UserInfo(
        id: json['id'],
        coverPictureUrl: json['coverPictureUrl'],
        nickname: json['nickname'],
        type: json['type'],
        musicCount: json['musicCount'],
        musicPlayCount: json['musicPlayCount']);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['coverPictureUrl'] = this.coverPictureUrl;
    data['nickname'] = this.nickname;
    data['type'] = this.type;
    data['musicCount'] = this.musicCount;
    data['musicPlayCount'] = this.musicPlayCount;
    return data;
  }
}
